import cv2
import numpy as np

img = np.zeros((480, 640, 3), np.uint8)
pts = np.array([(10, 10), (100, 100), (200, 10)], np.int32)
cv2.polylines(img, [pts], True, (0, 0, 255))
pts2 = np.array([(200, 200), (100, 100), (200, 100)], np.int32)
cv2.fillPoly(img, [pts2], (0, 0, 255))
while True:
    cv2.imshow('polylines', img)
    key = cv2.waitKey(10)
    if key & 0xFF == ord('q'):
        break

cv2.destroyAllWindows()
